<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateGoodsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('goods', function (Blueprint $table) {
            $table->increments('id');
            $table->string('goods',100);//商品名称
            $table->integer('typeid')->unsigned();//类别
            $table->string('company',50); //厂家
            $table->double('price',8,2); //单价
            $table->string('picname',150);//图片
            $table->text('descr');//商品描述
            $table->tinyInteger('state')->unsigned()->default(0); //状态
            $table->integer('store')->unsigned()->default(0); //库存量
            $table->integer('num')->unsigned()->default(0); //销售量
            $table->integer('clicknum')->unsigned()->default(0); //点击次数
            $table->integer('addtime')->unsigned(); //添加时间
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('goods');
    }
}
